Plex.Data.Global_Class = function()
{
	var self = this;
	
	this.glob = function()
	{
		var name = '';
		
		for ( var i=0; i < arguments.length; i++ )
		name += "_"+arguments[i];
		
		return name;
	}
	
	this.set = function(varName, varValue)
	{
		if(!self[varName])
		{
			self[varName] = new Object();
			self[varName].value = varValue;
			self[varName].watches = [];
		}
		else
		{
			self[varName].value=varValue;
			self[varName].watches.each(function(watch,x){
				watch(varValue);
			})
		}
	}
	
	this.get = function(varName)
	{
		if(self[varName])
		return self[varName].value;
		return false;
	}
	
	this.addWatch = function (varName,handler)
	{
		if(!self[varName])
		self.set(varName,false);
		
		self[varName].watches.push(handler);
	}
	
	this.create = function(name)
	{
		this[name] = new Plex.Data.Global_Class();
	}
}

Plex.Data.Global = Global = new Plex.Data.Global_Class();
